package com.example.accountbook;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeActivity extends AppCompatActivity {//欢迎页活动

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);//去除标题栏
//        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//去除状态栏
        setContentView(R.layout.activity_welcome);//加载欢迎页布局

        Timer timer = new Timer();//创建计时器对象
        TimerTask timerTask = new TimerTask() {//实现计时器任务接口，任务写在run
            @Override
            public void run() {//创建计时器任务对象
                Intent intent = new Intent(WelcomeActivity.this,GuideActivity.class);//创建显式intent用于启动引导页活动
                startActivity(intent);//启动活动方法
                WelcomeActivity.this.finish();//关闭欢迎页
            }
        };
        timer.schedule(timerTask,1000 * 3);//时间表方法，传入计时器任务，和计时时间
    }
}